<template>
    <view class="menus">
        <view class="menus-1" v-for="item in menuList" :key="item.id" @click="to(item.url)">
            <image :src="item.src" mode=""></image>
            <text>{{ item.name }}</text>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            menuList: [
                { id: 1, name: "借贷", src: "../../static/iamges/indexqianbao.png",url:'/pages/lending/lending' },
                { id: 2, name: "股票", src: "../../static/iamges/indexgupiao.png" ,url:"/pages/gubiaos/gubiaos"},
                { id: 3, name: "基金", src: "../../static/iamges/indexjiing.png" ,url:'/pages/riches/fund/fund'},
                { id: 4, name: "保险", src: "../../static/iamges/indexbaoxian.png" ,url:'/pages/insure/insure'},
                { id: 5, name: "理财", src: "../../static/iamges/indexlicai.png" ,url:'/pages/licai/licai'},
            ],
        };
    },
    onLoad() {},
    methods: {
        to(url){
            console.log(url);
			if(url=="/pages/lending/lending"){
				uni.switchTab({
					url
				})
			}else{
				uni.navigateTo({
					url
				})
			}
			
        }
    },
};
</script>

<style lang="scss" scoped>
.menus {
    width: 100%;
    height: 267rpx;
    display: flex;
    box-sizing: border-box;
    .menus-1 {
        box-sizing: border-box;
        height: 100%;
        width: 25%;
        text-align: center;
        color: #707070;
        padding-bottom: 43rpx;
        image {
            width: 122rpx;
            height: 122rpx;
            margin-top: 32rpx;
            margin-bottom: 27rpx;
        }
      
    }
}
</style>
